#ifndef TrainposView_H
#define TrainposView_H

#include "viewobject.h"
#include "paramobject.h"
#include <QLabel>
#include <QMovie>
#include <qdom.h>
#include <QTimer>

/************
 *显示当前车厢
 *normal 显示的资源名称
 *trainnum 车厢总数
 *cursq 当前车厢号
*************/

class QLabel;
class QMovie;
class HuaqiMovie;

typedef struct TrainposViewParam
{
    QString         m_train_normal;

    QString         m_train_one_left;
    QString         m_train_one_right;

    QString         m_train_two;
    QString         m_train_three;

    QString         m_train_four;
    QString         m_train_five;

    QString         m_train_six_left;
    QString         m_train_six_right;

    int             m_offset_x;

    TrainposViewParam()
    {
        m_train_normal = "";

        m_train_one_left = "";
        m_train_one_right = "";

        m_train_two = "";
        m_train_three = "";

        m_train_four = "";
        m_train_five = "";

        m_train_six_left = "";
        m_train_six_right = "";

        m_offset_x = 0;
    }
}TrainposViewParam;

class  TrainposView : public ViewObject
{
    Q_OBJECT
public:
    static int m_id;
    Q_INVOKABLE explicit TrainposView(QWidget *parent = 0);
    ~TrainposView();

    void ShowObject(QWidget*, QString filename = "", QString prefix = "", ProtocolData * ptr_data = NULL);

    void HideObject();

    void DestoryObject();

    void GetAttribute(std::string&);

    void SetAttribute(std::string);

    void ParseXML(QDomElement* );

    void PacketXML(QDomElement*);

public slots:
//    void TimeOutSlot();

private:
    QLabel                             *m_label;
//    QLabel                             *m_label_normal;
    QMovie                             *m_movie;
//    QMovie                             *m_movie_normal;
    HuaqiMovie                         *hq_movie;
//    HuaqiMovie                         *hq_movie_normal;
    TrainposViewParam*                  m_TrainposViewParam;
};

#endif // TrainposView_H
